package cn.huangsm.advance.optimisticlock.mapper;

import cn.huangsm.advance.optimisticlock.bean.User;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * updateUserUseCAS:使用CAS(Compare and set)更新商品信息. <br/>
 * @author huang
 * @PACKAGE_NAME cn.huangsm.advance.optimisticlock.mapper
 * @PROJECT_NAME advance-code
 * @date 2019/1/10
 */
@DS("master")
public interface UserMapper extends BaseMapper<User> {
    /**
     * 使用CAS方式实现乐观锁
     * @param user
     * @return
     */
    int updateUserUseCAS(@Param("user") User user);
}
